# !/usr/bin/env python
# -*- coding:utf-8 -*-
# author:darkleo
# create Date:2016/12/4


class Event(object):
    def __init__(self,paly_utils):
        self.paly_utils = paly_utils

    def play_all_song(self,music_list_box,music_data):
        #mylistbox.get(mylistbox.curselection())
        for music in music_data:
            song_id = music.get("song_id")
            self.paly_utils.play(song_id)

    def play_sign_song(self,music_list_box,music_data):
        select_index = music_list_box.curselection()[0]
        print("select_index:",select_index)
        music = music_data[select_index]
        song_id = music.get("song_id")
        self.paly_utils.play(song_id)